<?php $this->context->layout = 'fullout'; ?>


<?php $this->context->layout = 'form';?>

<div class="form-horizontal m" id="form-admin-add">
    <div class="form-group realname_field" style="text-align: center;">
        <img style="width: 13%;" src="<?=$info->avatar?>" alt="..." class="img-circle">
    </div>
    <div class="form-group realname_field">
        <label class="col-sm-3 control-label ">登录名称：</label>
        <div class="col-sm-8">
            <?=$info->username?>
        </div>
    </div>
    <div class="form-group realname_field">
        <label class="col-sm-3 control-label ">角色名称：</label>
        <div class="col-sm-8">
            <?=$roles?>
        </div>
    </div>
    <div class="form-group realname_field">
        <label class="col-sm-3 control-label ">人员名称：</label>
        <div class="col-sm-8">
            <?=$info->realname?>
        </div>
    </div>
    <div class="form-group realname_field">
        <label class="col-sm-3 control-label ">最后登录时间：</label>
        <div class="col-sm-8">
            <?=$info->last_time?>
        </div>
    </div>
</div>
<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="role-form">
                    <div class="select-list">
                        <ul>
                            <li><?= \common\widgets\FormInput::widget(['name'=>'input|登录地址','extend'=>['name'=>'like[ipaddr]']])?></li>
                            <li><?= \common\widgets\FormInput::widget(['name'=>'select|登陆状态','extend'=>['name'=>'where[status]','value'=>'','place'=>'所有','data'=>[1=>'成功',0=>'失败']]])?></li>
                            <li>
                                <?= $this->render('/iframe',['name'=>'searchbtn|搜索'])?>
                                <?= $this->render('/iframe',['name'=>'resetbtn|重置'])?>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>

<?php $this->beginBlock('script'); ?>
<script>
    $(function () {
        bootUrl.url = "<?=\yii\helpers\Url::toRoute('admin/login-log')?>"
        var options = {
            modalName: "登录日志",
            sortName:'id',
            sortOrder: "desc",
            columns: [
                {checkbox: true},
                {field: 'id', title: '日志ID', align: 'center', sortable: true},
                {field: 'login_name', title: '登录名称'},
                {field: 'login_location', title :'登录地点'},
                {field: 'ipaddr', title: '登录地址'},
                {field: 'browser', title: '浏览器'},
                {field: 'os', title: '操作系统'},
                {
                    title: '登录状态',
                    field: 'status',
                    align: 'center',
                    sortable: true,
                    formatter: function (value, row, index) {
                        return $.view.statusShow(row,false,['失败','成功']);
                    }
                },
                {field: 'msg', title: '操作信息'},
                {field: 'login_time', title: '登陆时间', align: 'center', sortable: true}
            ]
        };
        $.table.init(options);
    });
</script>
<?php $this->endBlock(); ?>

